<?php
    $ip="localhost";
    $user="数据库";
    $pwd="123456";
    $db="text";
    $conn=mysqli_connet($ip,$user,$pwd,$db);
    if(!$conn){
        die("连接失败：".$conn->connect_error);
    }
    echo "连接成功";
?>